using AdmissionQA.Application.Common;
using AdmissionQA.Application.Dtos.MajorInfo;
using AdmissionQA.Domain.Entities;

namespace AdmissionQA.Application.ServiceInterfaces;

/// <summary>
/// 专业信息服务接口
/// </summary>
public interface IMajorInfoServices
{
    /// <summary>
    /// 创建专业信息
    /// </summary>
    /// <param name="majorInfo">专业信息</param>
    /// <returns>创建结果</returns>
    Task<Result<string>> CreateMajorInfoAsync(MajorInfoDto majorInfo);

    /// <summary>
    /// 批量创建专业信息
    /// </summary>
    /// <param name="majorInfos">专业信息列表</param>
    /// <returns>创建结果</returns>
    Task<Result<string>> CreateMajorInfosAsync(MajorInfosDto majorInfos);

    /// <summary>
    /// 根据ID获取专业信息
    /// </summary>
    /// <param name="id">专业信息ID</param>
    /// <returns>专业信息</returns>
    Task<Result<MajorInfo>> GetMajorInfoByIdAsync(Guid id);

    /// <summary>
    /// 获取所有专业信息
    /// </summary>
    /// <returns>专业信息列表</returns>
    Task<Result<IEnumerable<MajorInfo>>> GetAllMajorInfosAsync();

    /// <summary>
    /// 分页获取专业信息
    /// </summary>
    /// <param name="pageIndex">页码</param>
    /// <param name="pageSize">页大小</param>
    /// <returns>分页结果</returns>
    Task<Result<IEnumerable<MajorInfo>>> GetPagedMajorInfosAsync(
        int pageIndex = 0,
        int pageSize = 10
    );

    /// <summary>
    /// 根据名称搜索专业信息
    /// </summary>
    /// <param name="majorName">专业名称</param>
    /// <returns>匹配的专业信息列表</returns>
    Task<Result<IEnumerable<MajorInfo>>> SearchMajorInfosByNameAsync(string majorName);

    /// <summary>
    /// 更新专业信息
    /// </summary>
    /// <param name="id">专业信息ID</param>
    /// <param name="majorInfo">专业信息</param>
    /// <returns>更新结果</returns>
    Task<Result<string>> UpdateMajorInfoAsync(Guid id, MajorInfoDto majorInfo);

    /// <summary>
    /// 删除专业信息
    /// </summary>
    /// <param name="id">专业信息ID</param>
    /// <returns>删除结果</returns>
    Task<Result<string>> DeleteMajorInfoAsync(Guid id);

    /// <summary>
    /// 批量删除专业信息
    /// </summary>
    /// <param name="ids">专业信息ID列表</param>
    /// <returns>删除结果</returns>
    Task<Result<string>> DeleteMajorInfosAsync(IEnumerable<Guid> ids);

    /// <summary>
    /// 获取专业信息总数
    /// </summary>
    /// <returns>专业信息总数</returns>
    Task<int> GetMajorInfoCountAsync();

    /// <summary>
    /// 基于向量相似度搜索专业信息
    /// </summary>
    /// <param name="text">查询文本</param>
    /// <param name="topK">返回最相似的前K个</param>
    /// <returns>最相似的专业信息列表</returns>
    Task<Result<IEnumerable<MajorInfo>>> SearchMajorInfosByEmbeddingAsync(string text, int topK = 5);
}
